package com.hkzhao.reportingsystem.component;

import com.hkzhao.reportingsystem.service.DoctorService;
import com.hkzhao.reportingsystem.service.MangerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//注册流程发送邮件消费者
@Component
@RabbitListener(queues = "reportsystem.doctor.register")
public class RegisterReceiver {
    private static Logger LOGGER = LoggerFactory.getLogger(RegisterReceiver.class);
    @Autowired
    private DoctorService doctorService;
    @RabbitHandler
    public void handle(String[] username_validCode)
    {
        LOGGER.info("发出注册验证码的邮件:{}",username_validCode[0]);
        doctorService.registerSendMail(username_validCode);
    }
}
